package com.minova.demo.entity;


import java.math.BigDecimal; 
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDateTime;
import java.util.List;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author linrongji
 * @since 2019-12-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName( value = "tz_prod",resultMap = "BaseResultMap")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class TzProd extends Model<TzProd> {

    private static final long serialVersionUID=1L;

    /**
     * 产品ID
     */
    @TableId(value = "prod_id", type = IdType.AUTO)
    private Long prodId;

    /**
     * 商品名称
     */
    private String prodName;
    
    public String getProdName() {
    	return this.prodName;
    }
    
    public void setProdName(String prodName) {
//    	if(prodName.length()>=5) {
//    		this.prodName=prodName.substring(1,10)+"...";
//    	}else {
//    		this.prodName = prodName;
//    	}
    	this.prodName = prodName;
    }
    
    /**
     * 店铺id
     */
    private Long shopId;

    /**
     * 原价
     */
    private BigDecimal oriPrice;

    /**
     * 现价
     */
    private BigDecimal price;

    /**
     * 简要描述,卖点等
     */
    private String brief;

    /**
     * 详细描述
     */
    private String content;

    /**
     * 商品主图
     */
    private String pic;

    /**
     * 商品图片，以,分割
     */
    private String imgs;

    /**
     * 默认是1，表示正常状态, -1表示删除, 0下架
     */
    private Integer status;

    /**
     * 商品分类
     */
    private Long categoryId;

    /**
     * 销量
     */
    private Integer soldNum;

    /**
     * 总库存
     */
    private Integer totalStocks;

    /**
     * 配送方式json见TransportModeVO
     */
    private String deliveryMode;

    /**
     * 运费模板id
     */
    private Long deliveryTemplateId;

    /**
     * 录入时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 上架时间
     */
    private LocalDateTime putawayTime;

    /**
     * 版本 乐观锁
     */
    private Integer version;

    
    private List<TzSku> tzSku;
    
    private List<TzProdComm> tzProdComms;
    

    @TableField(exist = false)
    private TzProdComm tzProdComm;
    
    @TableField(exist = false)

    private List<TzProdComm> tzProdCommList;
    
    private TzProdCommCountORrate tzProdCommCountORrate;
    

    @Override
    protected Serializable pkVal() {
        return this.prodId;
    }
    
}
